package com.spring.gll.dao.impl;

import org.springframework.jdbc.core.JdbcTemplate;

import javax.sql.DataSource;

public class TestJDBC {
    private DataSource dataSource;
    private JdbcTemplate template;

    public DataSource getDataSource() {
        return dataSource;
    }

    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
        this.template=new JdbcTemplate(dataSource);
    }

    public void add(){
        String sql="insert into tb_table values (null,'q')";
        template.update(sql);
    }
}
